<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');
?>
<script type="text/javascript">
<!--
	$(function(){
		$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
		$("#title").formValidator({onshow:"<?php echo L("input").L('title')?>",onfocus:"<?php echo L("input").L('title')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('title')?>"});
		$("#reg_fee").formValidator({onshow:"<?php echo L("input").L('reg_fee')?>",onfocus:"<?php echo L("input").L('reg_fee')?>",oncorrect:"<?php echo L('input_right');?>"}).regexValidator({regexp: regexEnum.num,onerror: '<?php echo L('reg_fee_error')?>'});
    	$('#reg_type').formValidator({onshow:"请选择类型",onfocus:"请选择类型",oncorrect:"<?php echo L('right')?>"}).inputValidator({min:1,onerror:"请选择类型"});	$("#number").formValidator({onshow:"<?php echo L("input").L('number')?>",onfocus:"<?php echo L("input").L('number')?>",oncorrect:"<?php echo L('input_right');?>",empty:true}).regexValidator({regexp: regexEnum.username,onerror: '<?php echo L('reg_fee_error')?>'});
	})
//-->
</script>
<div class="pad-lr-10">
<form action="?m=reg_child&c=manage&a=add" method="post" id="myform">
	<table width="100%"  class="table_form">
		  <tr>
		    <th width="120"><?php echo L('title')?>：</th>
		    <td class="y-bg"><input type="text" class="input-text" name="reg[title]" id="title" size="30" /></td>
		  </tr>
		  <tr>
		    <th><?php echo L('title_image')?>：</th>
		    <td class="y-bg"><?php echo form::images('reg[title_image]', 'title_image', '', 'reg_child', '', 30)?></td>
		  </tr>
		  <tr>
		    <th><?php echo L('reg_type')?>：</th>
		    <td class="y-bg">
		    	<?php echo form::select($this->reg_type, 0, ' name="reg[reg_type]" id="reg_type" ', '请选择类型')?>
		    </td>
		  </tr>
		  <tr id="reg_contest" style="display: none;">
		    <th><?php echo L('contest')?>：</th>
		    <td class="y-bg">
		    	<?php echo form::select($this->contest,0,'name="reg[contest_id]"','请选择')?>
		    </td>
		  </tr>
		  <tr id="reg_course" style="display: none;">
		    <th><?php echo L('course')?>：</th>
		    <td class="y-bg">
		    	<?php echo form::select($this->course,0,'name="reg[course_id]"','请选择')?>
		    </td>
		  </tr>
		  <tr>
		    <th><?php echo L('reg_fee')?>：</th>
		    <td class="y-bg">
		      <input type="text" name="reg[reg_fee]" id="reg_fee" value="">
		      <span style="color:red;">请输入纯数字，支持小数点后两位。例如：15.68</span>
		    </td>
		  </tr>
		  <tr>
		    <th><?php echo L('number')?>：</th>
		    <td class="y-bg">
		      <input type="text" name="reg[number]" id="number" value="">
		    </td>
		  </tr>
		  <tr>
		    <th><?php echo L('is_payed_online')?>：</th>
		    <td class="y-bg">
		      <?php echo form::radio(array('1'=>'是','2'=>'否'),1,'name=reg[is_payed_online]')?>
		    </td>
		  </tr>
		  <tr>
		    <th><?php echo L('is_to_talent')?>：</th>
		    <td class="y-bg">
		      <?php echo form::radio(array('1'=>'是','2'=>'否'),1,'name=reg[is_to_talent]')?>
		    </td>
		  </tr>
		  <tr>
		    <th><?php echo L('vote_asso')?>：</th>
		    <td class="y-bg">
		      <?php echo form::select($this->vote,0,'name=reg[vote_id] id="vote"','请选择')?>
		    </td>
		  </tr>
		  <tr>
		    <th><?php echo L('description')?>：</th>
		    <td class="y-bg"><textarea name="reg[description]" cols="60" rows="10" ></textarea></td>
		  </tr>
	</table>
<div class="bk15"></div>
    <input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="<?php echo L('submit');?>" />
</form>
</div>
<script language="JavaScript">
<!--
	$("#reg_type").change(function() {
		var reg_type = $(this).val();
		if (!reg_type) {
			$("#reg_contest").hide();
			$("#reg_course").hide();
		} else if(reg_type == 1) {
			$("#reg_contest").show();
			$("#reg_course").hide();
		} else if(reg_type == 2) {
			$("#reg_contest").hide();
			$("#reg_course").show();
		}
	})
	//-->
</script>
</body>
</html>